// Spyroid, by Erlend Robaye, October 2001
// In honour to the song SPYROID by the Ozric Tentacles.

Stps=720,

Aspc=1,

A0="1.7",				             // Begin radius of the spiral
A1="rnd( .2 ) + .03",			  // Scaling percentage to get inner radius from outer radius
A2="A1 * A0",	            // Inner radius of the spiral
A3="rnd(15) + 5",			      // Number of teeth
A4="rnd( .6 ) + .1",			   // Oscillation freq
A9="rnd( 2 )",            // Oscillation deflection
A5="t",					              // Remember time to be able to speed-up, slow down rotation
A6=".12",			 	            // Scaling of magnitude


// Intermed vars
A7="8 * PI",
A8="A7 * A3",



C0="A0 * ( 1.05 - s )",			  // radius

//C1="s * 8 * PI",			       // angle + b0




C1="fft( 2 * s ) * A6",

C2="sin( s * A8 + .2 )",    // To avoid beginning with a jump and creating a hole

// sgn of sin flips from -1 to 1
C3="sgn( C2 )",

C4="C0 - ( C1 * C3 )",

// Draw the sprial-sprocket
// Make the radius change with the sin at every interval the sign of the sin changes
C5="C4 * cos( A7 * s )",
C6="C4 * sin( A7 * s )",


B0="a9 * sin( a4 * (t - A5) )",
B1="cos(B0)",
B2="sin(B0)",

X0="-B1 * C6 - B2 * C5",
Y0=" B1 * C5 - B2 * C6",

LWdt="1",

ConB=1,

Vers=100

